package com.sun.dailyprj.view;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.sun.dailyprj.R;
import com.sun.dailyprj.databinding.ActivityArcpgBinding;
import com.sun.dailyprj.util.Logger;
import com.sun.dailyprj.view.canvas.ArcProgress;

/*
 * =====================================================================================
 * Summary:
 *
 * File: ArcProgressActivity.java
 * Author: Yanpeng.Sun
 * Create: 2020/6/9 17:14
 * =====================================================================================
 */
public class ArcProgressActivity extends AppCompatActivity implements ArcProgress.ArcCallBack{

    ActivityArcpgBinding mBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_arcpg);
        mBinding.setArc(ArcProgressActivity.this);
//
        mBinding.cheryNotifyArcp.setMax(100);
        mBinding.cheryNotifyArcp.startProgress(20*1000,200);
        mBinding.cheryNotifyArcp.setArcCallBackListener(this);
    }

    @Override
    public void onProgress(float pg, long time) {
        Logger.debug("pg:" + pg + " ; time:" + time);
    }

    @Override
    public void onFinish() {
        Logger.debug("finish");
    }
}
